//////////////////////////////////////////////////////////////////////////////
//                                                                          //
//     Filename: VPXMLTranslator.h                                          //
//  Create date: July 19, 2004                                              //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////
//                                                                          //
//  Description: This file describes the VPXMLTranslator class.  This class //
//                is a protocol translator that translates from the RTG     //
//                Video Poker protocol to XML and back.                     //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////
//       Copyright (c) 2004 - Realtime Gaming.  All rights reserved.        //
//////////////////////////////////////////////////////////////////////////////

#ifndef __VP_XML_TRANSLATOR__
#define __VP_XML_TRANSLATOR__

#include "XMLTranslator.h"

//////////////////////////////////////////////////////////////////////////////
// VPXMLTranslator Class
//////////////////////////////////////////////////////////////////////////////
class VPXMLTranslator : public XMLTranslator
{
public:
    VPXMLTranslator( Server* pServer, Connection* pParent );
    virtual ~VPXMLTranslator();

    // Public Interface
    virtual bool8  TranslateIncomingMessage( uint8* pGameInBuff,  uint32 nGameInBuffSize, uint8* pBuff, uint32 nOutBuffSize );
    virtual uint32 TranslateOutgoingMessage( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize, uint32 nTotalGameBytes );

public:
	// Defines
	enum { MAX_CARDS = 5 };

protected:
	// Internal Helpers
	bool8 AddCards( XMLDoc* pDoc, uint8* pBuff, uint32& nOffset, const String& sParentNode );
    bool8 AddPayTableInfo( XMLDoc* pDoc, uint8 nPayTable );

	// Incoming
	bool8 TranslateInLogin     ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInReload	   ( XMLDoc* pDoc, uint8* pGameInBuff, uint32 nGameInBuffSize ); // CSN-13423
	bool8 TranslateInDeal      ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInHold      ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInDoubleDeny( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInDoubleDeal( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInDoubleDraw( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );

	// Outgoing
	bool8 TranslateOutLogin  ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize, bool isReload=false );
	bool8 TranslateOutDeal   ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutSubGame( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutHold   ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutOptions( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	
    bool8 TranslateOutDoubleDeny( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
    bool8 TranslateOutDoubleDeal( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
    bool8 TranslateOutDoubleDraw( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );

    bool8 TranslateOutError   ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );

};

#endif //#ifndef __VP_XML_TRANSLATOR__